<?php include _include(ADMIN_PATH.'view/htm/header.inc.htm');?>

<div class="row">
	<div class="col-lg-12">
		<div class="btn-group m-b-1" role="group">
			<?php echo admin_tab_active($menu['plugin']['tab'], $tab);?>
		</div>
		<div class="card card-block">
			<div class="row">
				<dl class="row m-a-1">
					<dt style="width: 70px;">
						<img src="<?php echo $plugin['icon_url']; ?>" width="54" height="54" />
					</dt>
					<dd class="vtop">
						<h4><?php echo $plugin['name']; ?> v<?php echo $plugin['version']; ?></h4>
						<p><?php echo $plugin['brief']; ?></p>
					</dd>
				</dl>
			</div>
			<hr />
			<div class="row">
				<div class="col-md-4 p-l-2 p-r-2">
					<dl class="row m-b-1">
						<dt class="text-muted"><?php echo lang('plugin_dir');?>：</dt>
						<dd class="text-right"><?php echo $dir; ?></dd>
					</dl>
					<dl class="row m-b-1">
						<dt class="text-muted"><?php echo lang('plugin_bbs_version');?>：</dt>
						<dd class="text-right"><?php echo $plugin['bbs_version']; ?></dd>
					</dl>
				</div>
				<?php if($plugin['pluginid']) { ?>
				<div class="col-md-4 p-l-2 p-r-2">
					<dl class="row m-b-1">
						<dt class="text-muted"><?php echo lang('price');?>：</dt>
						<dd class="text-right"><?php echo $plugin['price']; ?></dd>
					</dl>
					<dl class="row m-b-1">
						<dt class="text-muted"><?php echo lang('installs');?>：</dt>
						<dd class="text-right"><?php echo $plugin['installs']; ?></dd>
					</dl>
					<dl class="row m-b-1">
						<dt class="text-muted"><?php echo lang('plugin_user_stars_fmt');?>：</dt>
						<dd class="text-right"><?php echo $plugin['user_stars_fmt']; ?></dd>
					</dl>
					<dl class="row m-b-1">
						<dt class="text-muted"><?php echo lang('plugin_sells');?>：</dt>
						<dd class="text-right"><?php echo $plugin['sells']; ?></dd>
					</dl>
					<dl class="row m-b-1">
						<dt class="text-muted"><?php echo lang('plugin_is_cert');?>：</dt>
						<dd class="text-right"><?php echo $plugin['is_cert']; ?></dd>
					</dl>
				</div>
				<?php  } ?>
			</div>
		</div>
		<p class="text-center">
			<?php if(!$plugin['downloaded']) { ?>
			<a role="button" class="btn btn-primary download" href="<?php echo url("plugin-download-$dir"); ?>"><?php echo lang('download');?></a>
			<?php } ?>
			
			<?php if($plugin['setting_url']) { ?>
			<a role="button" class="btn btn-primary setting" href="<?php echo url("plugin-setting-$dir"); ?>"><?php echo lang('setting');?></a>
			<?php } ?>
			
			<?php if(!$plugin['installed']) { ?>
			<a role="button" class="btn btn-primary install" href="<?php echo url("plugin-install-$dir"); ?>"><?php echo lang('install');?></a>
			<?php } ?>
			
			<?php if($plugin['installed'] && $plugin['enable']) { ?>
			<a role="button" class="btn btn-secondary disable" href="<?php echo url("plugin-disable-$dir"); ?>"><?php echo lang('disable');?></a>
			<?php } ?>
			
			<?php if($plugin['installed'] && !$plugin['enable']) { ?>
			<a role="button" class="btn btn-secondary enable" href="<?php echo url("plugin-enable-$dir"); ?>"><?php echo lang('enable');?></a>
			<?php } ?>
			
			<?php if($plugin['installed']) { ?>
			<a role="button" class="btn btn-danger unstall confirm" data-confirm-text="<?php echo lang('plugin_unstall_confirm_tips', array('name'=>$plugin['name']));?>" href="<?php echo url("plugin-unstall-$dir"); ?>"><?php echo lang('unstall');?></a>
			<?php } ?>
			
			<?php if($plugin['have_upgrade']) { ?>
			<a role="button" class="btn btn-primary upgrade" href="<?php echo url("plugin-upgrade-$dir"); ?>"><?php echo lang('update');?></a>
			<?php } ?>
			
			
		</p>
		
		<p class="m-t-2 text-center">
			<a role="button" class="btn btn-secondary" href="javascript:history.back();" style="width: 210px;"><?php echo lang('back');?></a>
		</p>
	</div>
</div>

<?php include _include(ADMIN_PATH.'view/htm/footer.inc.htm');?>

<script>
$('#nav_pc li.plugin, #nav_mobile li.plugin').tab('show');
</script>